﻿using System.Data.Entity.ModelConfiguration;

namespace MP.Data.Models.Models.Mapping
{
    public class MeasureMap : EntityTypeConfiguration<Measure>
    {
        public MeasureMap()
        {            
            this.HasKey(t => t.Id);
                     
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Measure", "Prices");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Name).HasColumnName("Name");
        }
    }
}
